<!-- 图片或者视频  -->
<template>
	<view class="conponentsPagesContent">
		<view class="itemView" v-for="(item,index) in list " :key="index" v-if="list.length != 0 ">
			<view class="item ">				
				<view class="left" @click="goPreview(item, index)">					
					<image class="icon" v-if="scanType=='FILE' || scanType== 'ALL_FILE'" src="../../static/images/hyisFileIcon.png" mode=""></image>
					<image class="icon"  v-if="scanType=='AUDIO' || scanType== 'ALL_AUDIO'" src="../../static/images/mp3Icon.png" mode=""></image>
					<image class="icon"  v-if="scanType=='VIDEO' || scanType== 'ALL_VIDEO'" src="../../static/images/mp4Icon.png" mode="aspectFit"></image>
				</view>
				<view class="content" @click="goPreview(item, index)"> {{ item.fileName | sliceFileName }}</view>
			</view>
		</view>
		<view class="noData" v-if="list.length == 0 "> 正在努力扫描中。。。 </view>
	</view>
</template>

<script>
	export default {
		props: {		
			scanType: {
				default: null,
				type: String
			},
			list: {
				default: [],
				type: Array
			}
		},
		data() {
			return {}
		},
		methods: {			
			goPreview(item, index) {
				uni.setStorageSync("selectItem", JSON.stringify(item))
				this.$emit("goPreviewItem") //点击单个跳转预览				
			}
		}
	}
</script>
<style lang="scss" scoped>
	.conponentsPagesContent {
		padding: 0 16rpx;

		.itemView {
			.item {
				height: 100rpx;
				margin-bottom: 30rpx;

				.select {
					float: left;
					width: 100rpx;
					height: 100rpx;
					display: flex;
					justify-content: center;
					align-items: center;

					.icon {
						display: block;
						width: 30rpx;
						height: 30rpx;
					}
				}

				.left {
					float: left;
					width: 100rpx;
					height: 100rpx;
					margin-right: 30rpx;
					justify-content: center;
					align-items: center;

					.icon {
						display: block;
						width: 100rpx;
						height: 100rpx;

					}
				}

				.content {
					float: left;					
					height: 100rpx;
					line-height: 100rpx;
					font-size: 32rpx;
					font-weight: 500;
					color: #000000;
					white-space: nowrap;
					overflow: hidden;
					text-overflow: ellipsis;



				}

			}
		}

		.noData {
			font-size: 24rpx;
			height: 200rpx;
			line-height: 200rpx;
			text-align: center;			
			color: #939599;
		}
	}
</style>